import { Config } from "./src/config/Config";
import { DbConfig } from "./src/config/DbConfig";
import { ServerConfig } from "./src/config/ServerConfig";
import { Base64Helper } from "./src/engine/utils/Base64Helper";
import DateUtil from "./src/engine/utils/DateUtil";
import { Logger } from "./src/engine/utils/Logger";
import { MysqlClient } from "./src/engine/utils/MySqlClient";
import { MysqlManager } from "./src/engine/utils/MysqlManager";
import { ShellHelper } from "./src/engine/utils/ShellHelper";
import { TimerUtil } from "./src/engine/utils/TimerUtil";
import { SystemSettingModel } from "./src/model/SystemSettingModel";

export class Test {


    public static instance: Test = new Test()

    public async main() {
        let port: number = parseInt(process.argv[2]);
        if (isNaN(port)) {
            Logger.error("port为空")
            return;
        }

        let environment: number = parseInt(process.argv[3]);
        if (isNaN(port)) {
            Logger.warn("environment为空")
            return;
        }
        Config.environment = environment;
        if (Config.environment == Config.EnvironmentType.Online) {
            Logger.LEVEL = Logger.LOG_LEVEL_TYPES.LOG;
        } else {
            Logger.LEVEL = Logger.LOG_LEVEL_TYPES.DEBUG
        }
        Config.serverType = Config.ServerType_List.log_server;
        Logger.tag = Config.serverType + "-" + port
        DbConfig.init(DbConfig.Db_Type.Dev)
        TimerUtil.init();
        // await ServerConfig.initConfig(port)


        ShellHelper.getOnline()


    }


}



Test.instance.main()